package com.markul.android.ui.main.mainFragment

import android.content.Intent
import android.os.Bundle
import androidx.fragment.app.Fragment
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import com.markul.android.R
import com.markul.android.ui.personal.PersonalActivity
import com.markul.android.ui.mark.MarkActivity
import com.markul.android.ui.badge.BadgeActivity
import kotlinx.android.synthetic.main.my_main_fragment.*

class MyMainFragment : Fragment() {

    companion object {
        fun newInstance() = MyMainFragment()
    }

    override fun onCreateView(
        inflater: LayoutInflater, container: ViewGroup?,
        savedInstanceState: Bundle?
    ): View? {
        return inflater.inflate(R.layout.my_main_fragment, container, false)
    }

    override fun onActivityCreated(savedInstanceState: Bundle?) {
        super.onActivityCreated(savedInstanceState)
        myMarkBtn.setOnClickListener {
            val intent = Intent(context, MarkActivity::class.java)
            intent.putExtra("who","my")
            startActivity(intent)
        }
        personalBtn.setOnClickListener {
            val intent = Intent(context, PersonalActivity::class.java)
            startActivity(intent)
        }
        badgeBtn.setOnClickListener{
            val intent = Intent(context, BadgeActivity::class.java)
            startActivity(intent)
        }

    }

}